//封装请求接口
function W_request(options){
	//异步处理Promise 等待是某某某 成功调用resolve 失败调用reject
	return new Promise((resolve,reject)=>{
		
		const prefix = 'https://xcx.xyhvip.cn/';//固定链接
		uni.request({
			url:prefix+options.url,
			method:options.method || 'GET',
			data:options.data || {},
			header: options.header || { 'Content-Type': 'application/json' },
			success:(res)=>{
				if(res.statusCode === 200){
					resolve(res);
				}else{
					reject(res);
				}
			},
			fail:(err)=>{
				reject(err);
			},
			
		});//request
		
	});//Promise
}
export default W_request;
// /api/index/svga